package com.conversationboard.controller;

import java.io.IOException;
import java.security.Principal;
import java.sql.SQLException;

import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.conversationboard.model.User;

public class AdminPreCreateInterestGroupControllerServlet extends HttpServlet {

	private static final long serialVersionUID = -1702158260405246728L;


	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

		try {
			Principal principal = request.getUserPrincipal();

			User user = User.get(principal.getName());

			request.setAttribute("user", user);

			RequestDispatcher dispatcher = request.getRequestDispatcher("/Pages/Admin/createinterestgroup.jsp");
			dispatcher.forward(request, response);

		} catch (SQLException e) {
			throw new ServletException(e);
		}

	}

}
